package com.itheima.mapper;

import com.itheima.dto.OrderSettingDto;
import com.itheima.pojo.OrderSetting;
import com.itheima.vto.OrderSettingPre;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface OrdersettingMapper {
    @Update("update t_ordersetting set number =#{number} where orderDate=#{orderDate}")
    boolean editNumberByOrderDate(OrderSettingDto orderSetting);
    @Select("SELECT * from t_ordersetting where YEAR(orderDate) =#{year} and MONTH(orderDate) = #{month}")
    List<OrderSettingPre> getOrderSettingByMonth(@Param("year") int year, @Param("month") int month);
    /**
     * 增加预约设置数据
     * @param orderSettingDto
     */
    @Insert("insert into t_ordersetting(orderDate,number) value (#{orderDate},#{number})")
    void addData(OrderSettingDto orderSettingDto);
}
